<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/base/jsp/include.jsp"%>
<style>
</style>
<script type="text/javascript">
	var id = "${id}";
	
	var submitForm = function($dialog, $grid, $pjq) {
		if ($('form').form('Validate')) {
			var url = sy.contextPath + '/social/labelSave.do';
			var obj = sy.serializeObject($('form'));
			$.post(url,obj , function(result) {
				if (result.code == 0) {
					$grid.datagrid('reload');
					$dialog.dialog('destroy');
				} else {
					$pjq.messager.e(result.msg);
				}
			}, 'json');
		}
	};

	$(function() {
		$('#cateCode').combobox({    
		    url:'social/cateTree.do?combotree=1&level=1',
		    valueField:'code',
		    textField:'title'
		});
		
		if (id != '') {
			$.post(sy.contextPath + '/social/findLabelById.do', {
				id : id
			}, function(result) {
				if (result) {
					$('form').form('load', result);
				}
			}, 'json');
			
			$('#cateCode').combobox({novalidate:true,disabled:true});
			$('#title').textbox({novalidate:true,disabled:true});
		}
	});
</script>
</head>
<body>
	<form id="form" method="post">
        <input name="id" type="hidden" />
        <div style="padding:15px;font-size: 12px">
            <table style="table-layout:fixed;" border="0" cellspacing="0" class="formtable">
            	<tr>
                    <th style="width:100px;">分类：</th>
                    <td>
                    	 <select id="cateCode" name="cateCode" editable="false" required="true" style="width:150px;" prompt="请选择"/>
                    </td>
                </tr>
            	<tr>
                    <th style="width:100px;">名称：</th>
                    <td>
                    	 <input id="title" name="title" class="easyui-textbox" data-options="required:true,validType:['length[0,25]']" missingMessage="请输入名称" style="width:90%;" prompt="请输入名称"/>
                    </td>
                </tr>
                <tr>
                    <th style="width:100px;">热门指数(倒序)：</th>
                    <td>   
                    	 <input id="hotRate" name="hotRate" class="easyui-numberbox" data-options="required:true,min:0,max:99999" value="" missingMessage="请输入热门指数" prompt="请输入热门指数(0为不热门)" style="width:90%;"/>
                    </td>
                </tr>
                <tr>
                	<th style="width:100px;">描述：</th>
                	<td>
				  		<input id="remark" name="remark" class="easyui-textbox" data-options="multiline:true" style="width:90%;height: 200px" prompt="请输入描述" missingMessage="请输入描述"/>
				  	</td>
                </tr>
            </table>
        </div>
	</form>
</body>
</html>